
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <!-- https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CSP -->
    <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
    <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
    <title>Hello World!</title>
    <style>
     body{ 
     font-family: monospace;
    }
    </style>

  </head>
  <body style="padding: 10px">
    <div style="display: none">
      <input type="file" id="file1" />
      <script>
        let fileEle = document.getElementById('file1')
        fileEle.onchange = function (e) {
          if (window.handle_select_file_browser) window.handle_select_file_browser(e.target.files?.[0])
          setTimeout(() => {
            fileEle.value = ''
          }, 100)
        }
      </script>
    </div>
    <section>
      <h1>CRC64测试</h1>
      <button id="btn-crc64-browser">选择文件 (浏览器js计算) 2.8s</button> 
      <button id="btn-crc64-node">请选择文件 (Nodejs 计算) 1.5s</button>
      <button id="btn-crc64-node-process">请选择文件 (Nodejs 子进程计算) 2.8s</button>
      
      <div></div>
    </section>
    <section>
      <h1>Sha1测试</h1>
      <button id="btn-sha1-browser">选择文件 (浏览器js 串行计算) 16.5s</button>
      <button id="btn-sha1-mul-browser">选择文件 (浏览器js 并行计算) 28.9s</button>
      <div>&nbsp;</div>
     
      <button id="btn-sha1-node">请选择文件 (Nodejs 串行计算) 1.0s</button>
      <button id="btn-sha1-mul-node">请选择文件 (Nodejs 并行计算) 26.5s</button>
      <div>&nbsp;</div>
      <button id="btn-sha1-node-process">请选择文件 (Nodejs 子进程串行计算) 1.1s</button>
      <button id="btn-sha1-mul-node-process">请选择文件 (Nodejs 子进程并行计算) 3.2s</button>
      <div></div>
    </section>
    <section>
      <h1>上传下载文件</h1>
      <button id="btn-upload-browser">browser (标准并行)上传文件</button>
      <button id="btn-upload-serial-browser">browser (标准串行)上传文件</button>
      <div>&nbsp;</div>
      <button id="btn-upload">node (标准并行)上传文件</button>
      <button id="btn-upload-serial">node (标准串行)上传文件</button>
      <!-- <button id="btn-upload-hosting">node (托管)上传文件</button> -->
      <button id="btn-download" disabled>node 下载文件</button> 
    </section>

    <section id="msg"></section>

    <script src="bin/tmp-js-sdk.min.js"></script>
    <script src="bin/conf.js"></script>
    <script src="bin/common.js"></script>
    <script src="test-crc64.js"></script>
    <script src="test-sha1.js"></script>
    <script src="test-upload-download.js"></script>
  </body>
</html>
